<script setup lang="ts">
import { onBeforeMount } from "vue";

onBeforeMount(() => {
  let time = new Date().toTimeString();
  if (parseInt(time.slice(0, 2)) <= 24 && parseInt(time.slice(0, 2)) >= 8) {
    document.documentElement.style.setProperty("--theme-color", "white");
    document.documentElement.style.setProperty("--font-color", "black");
  }
});
</script>

<template>
  <div class="holder" id="app">
    <router-view v-slot="{ Component }">
      <keep-alive>
        <component
          :is="Component"
          :key="$route.name"
          v-if="$route.meta.keepAlive"
        />
      </keep-alive>
      <component
        :is="Component"
        :key="$route.name"
        v-if="!$route.meta.keepAlive"
      />
    </router-view>
  </div>
</template>
<style scoped lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 1vh;
}
</style>
